package tasktracker.core.abstraction;

import java.util.Date;
import java.util.Map;

import tasktracker.abstraction.TaskInfo;

public class FrameworkTrackedTaskInfo extends FrameworkTrackedTask {
	private TaskInfo task;

	public FrameworkTrackedTaskInfo(TaskInfo task, String name, String trackerName, String owner,
			Date createdDateTimeUtc) {
		this.task = task;
		super.setName(name);
		super.setTrackerName(trackerName);
		super.setOwner(owner);
		super.setCreatedDateTimeUtc(createdDateTimeUtc);
	}

	@Override
	public TaskInfo toTaskInfo() {
		return task;
	}

	public TaskInfo getTask() {
		return task;
	}

	public void setTask(TaskInfo task) {
		this.task = task;
	}

	@Override
	public String getGuid() {
		return task.getGuid();
	}

	@Override
	public void setGuid(String guid) {
		task.setGuid(guid);
	}

	@Override
	public String getInputPath() {
		return task.getInputPath();
	}

	@Override
	public void setInputPath(String inputPath) {
		task.setInputPath(inputPath);
	}

	@Override
	public String getOutputPath() {
		return task.getOutputPath();
	}

	@Override
	public void setOutputPath(String outputPath) {
		task.setOutputPath(outputPath);
	}

	@Override
	public Map<String, String> getProperties() {
		return task.getProperties();
	}

	@Override
	public void setProperties(Map<String, String> properties) {
		Map<String, String> target = task.getProperties();
		target.clear();
		for (Map.Entry<String, String> prop : properties.entrySet()) {
			target.put(prop.getKey(), prop.getValue());
		}
	}

	@Override
	public int getStatus() {
		return task.getStatus();
	}

	@Override
	public void setStatus(int status) {
		task.setStatus(status);
	}

}
